export async function  getReArticle (app) {
  // 获取最近的几篇文章
  let paramsRecentlyArticle = {
    pageNo: 1,
    pageSize: 8,
    cmd: 1
  },reArticle = []
  await app.$axios({url:"/article/get",params:paramsRecentlyArticle}).then(({data})=>{
    // console.log(data)
    if (data.code === 200) {
      // console.log(data)
      reArticle = data.data.map((item) => {
        if (item.articlePutTop == 1) return
        return {
          title: item.articleTitle,
          route: `/article-detail/${item.oId}`
        }
      }).filter(tmp => tmp)
    }
  })
  return reArticle
}


export function getMoviesDetail(service,data){
  return service.post("/article/getByPath",data)
}

export function recordCount(service,data){
  return service.post("/article/recordViewCount",data)
}

export function getPhotoList(service,){
  return service.get("/article/draw/get")
}

export function getArticleList(service,params) {
  return service({
    url:"/article/get",
    params
  })
}

export function getTagArticle(service,data) {
  return service({
    url:"/tag/article/get",
    method:"POST",
    data
  })
}
